# your-async-share

```bash
npm i your-async-share
```

### asyncShare(fn)
- `fn` <[function]> 原方法
- return <[function]> 新方法

同时调用异步方法，只执行一次，并共享结果

```js
import asyncShare from 'your-async-share'

const oldMethod = () => {
  // 返回 Promise 实例
}

const newMethod = asyncShare(oldMethod)
newMethod()
newMethod()
```

[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function"
